package com.fatmeraid.controller.register;

import com.fatmeraid.common.result.Result;
import com.fatmeraid.service.RegisterService;
import com.fatmeraid.vo.RegisterVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "注册")
@RestController
@RequestMapping("/register")
public class Register {

	@Autowired
	private RegisterService registerService;
	/**
	 *  用户注册
	 */
	@Operation(summary = "用户注册")
	@PostMapping
	public Result<String> register(@RequestBody RegisterVo registerVo) {
		boolean result =registerService.register(registerVo);
		if (!result) {
			return Result.fail();
		}
		return Result.ok();
	}
}
